<?php
/* @var $this LocationController */
/* @var $model Location */
/* @var $form CActiveForm */

if(empty($params['displayArea'])){
	$tab=array();
	$loc=new Location('search');
	$loc->unsetAttributes();  // clear any default values
	$loc->setAttribute('home', 1);
	$dataProvider=$loc->search();
	$params['displayArea']=array();
	foreach ($dataProvider->getData() as $data){
		$tab[]=$data;
	}
}else{
	$tab=array();
	foreach ($params['displayArea']->favorites as $fav)
		$tab[]=$fav->idLocation;
}

?>
<table width="1024" border="0" align="left" cellpadding="3" cellspacing="0" id="cadrePremium">
            <tr>
              <td width="109" rowspan="3"><p class="titresIndex"><a href="<?php echo Yii::app()->request->baseUrl; ?>"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/france-smll.png" alt="" width="108" height="112" border="0" align="left"></a></p></td>
              <td colspan="3" class="titresPremium">
              <?php 
              if(!empty($params['displayArea']))
              	echo Yii::t('main', 'our-area-location-hearth')." ".CHtml::encode($params['displayArea']->name);
              else echo Yii::t('main', 'our-france-location-hearth');              
              ?>
              <br></td>
              <td width="301" rowspan="3" align="center" class="titresPremium"><a href="#"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icon-selectby.png" alt="" width="76" height="89" border="0"></a><br>
                <br><?php echo Yii::t('main', 'quality-charter');?></td>
            </tr>
            <tr class="legendePremium">
              <td width="302" align="center">           
              <?php if(!empty($tab[0]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[0])); 
              ?>              
              </td>
              <td width="302" align="center">
               <?php if(!empty($tab[1]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[1])); 
              	?>     
              </td>
              <td width="301" align="center">
                <?php if(!empty($tab[2]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[2])); 
              	?>     
               </td>
            </tr>
            <tr class="legendePremium">
              <td align="center" class="legendePremium">
                <?php if(!empty($tab[3]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[3])); 
              ?>     
              </td>
              <td align="center" class="legendePremium">
                <?php if(!empty($tab[4]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[4])); 
              ?>     
              </td>
              <td align="center" class="legendePremium">
                <?php if(!empty($tab[5]))
              		$this->renderPartial('_favorite_item',array('location'=>$tab[5])); 
              ?>     
              </td>
            </tr>
</table>